import { queryDictData, queryPerson } from '@/utils/common';

export const plateList = [
  { key: '港澳牌', val: '港澳牌' },
  { key: '浙', val: '浙' },
  { key: '粤', val: '粤' },
  { key: '京', val: '京' },
  { key: '津', val: '津' },
  { key: '冀', val: '冀' },
  { key: '晋', val: '晋' },
  { key: '辽', val: '辽' },
  { key: '沪', val: '沪' },
  { key: '吉', val: '吉' },
  { key: '苏', val: '苏' },
  { key: '皖', val: '皖' },
  { key: '赣', val: '赣' },
  { key: '鲁', val: '鲁' },
  { key: '豫', val: '豫' },
  { key: '鄂', val: '鄂' },
  { key: '湘', val: '湘' },
  { key: '琼', val: '琼' },
  { key: '渝', val: '渝' },
  { key: '川', val: '川' },
  { key: '贵', val: '贵' },
  { key: '云', val: '云' },
  { key: '陕', val: '陕' },
  { key: '甘', val: '甘' },
  { key: '青', val: '青' },
  { key: '蒙', val: '蒙' },
  { key: '黑', val: '黑' },
  { key: '桂', val: '桂' },
  { key: '藏', val: '藏' },
  { key: '宁', val: '宁' },
];

export const dateFormat = 'YYYY-MM-DD';

export const driversColumns = [
  {
    title: '姓名',
    dataIndex: 'name',
    width: '40%',
  },
  {
    title: '工号',
    dataIndex: 'workerNo',
    width: '20%',
  },
  {
    title: '电话',
    dataIndex: 'phoneNumOne',
    width: '20%',
  },
];

export function queryDict({ props }) {
  const { dispatch, dictObject } = props;
  const allDict = ['vehicle_category', 'vehicle_type', 'coach', 'vehicle_properties'];
  allDict.map(v => {
    queryDictData({
      dispatch,
      payload: { code: v },
      isExist: dictObject[v],
    });
  });
}

// export function selectVehicleList({ dispatch, searchVal, payload = {} } = {}) {
//   const { dispatch, searchValue } = this.props;
//   dispatch({
//     type: 'vehicle/selectVehicleList',
//     payload,
//     callback: data => {
//       if (!data) return;
//       queryPerson({ data, searchValue, dispatch });
//     },
//   });
// }
